<template>
  <div>
    <div v-if="isLoad">
      <van-skeleton title :row="3" />
    </div>
    <div v-else>
      <van-row>
        <van-col span="8">
          <h2 class="title">{{ timer }}。</h2></van-col
        >
      </van-row>
      <van-row>
        <van-col span="21">
          <van-search @click="gotoseach" v-model="value" placeholder="请输入搜索关键词"
        /></van-col>
        <van-col span="3"
          ><van-icon class="icon" name="chat-o" size="1.5rem"
        /></van-col>
      </van-row>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
      timer: "",
      isLoad: true,
      RecommendList: [],
      url: "https://img.9lele.com"
    };
  },
  mounted() {
    setTimeout(
      function () {
        this.isLoad = false;
      }.bind(this),
      500
    );
  },
  methods:{
    gotoseach(){
      this.$router.push('/seach')
    }
  },
  created() {
    let time = new Date();
    let hour = time.getHours();

    if (hour > 6 && hour < 8) {
      this.timer = "早上好";
    } else if (hour >= 8 && hour < 12) {
      this.timer = "上午好";
    } else if (hour >= 12 && hour < 18) {
      this.timer = "下午好";
    } else if (hour >= 18 && hour < 23) {
      this.timer = "晚上好";
    } else if (hour >= 23 && hour < 6) {
      this.timer = "凌晨了";
    }
  },
};
</script>

<style  scoped="scoped">
.icon {
  margin-top: 1.5vh;
}
</style>